function sub_x = JADE1(sub_x, sample_y, best_x, index1, maxIteration, dim, LB, UB, Fun)

muCR = 0.5;    % 相关变量的初始化
muF = 0.5;
A = [];
p = 0.1;
c = 0.2;
popsize = size(sub_x,1);

for time = 1 : maxIteration
    SF = [];
    SCR = [];
    for i = 1 : popsize

        CR = normrnd(muCR, 0.1);    % 正太随机数   
        F = Cauchy_rand(muF, 0.1);    % 柯西随机数

        index = randperm(popsize);
        lpbest = [];
        k = p * popsize;
        subSizeIndex = popsize / k;
        for i0 = 1 : k
            index0 = ((i0 - 1) * subSizeIndex + 1) : i0 * subSizeIndex;
            eachLevelFitness = sample_y(index(index0));
            eachLevelSol = sub_x(index(index0), :);
            [~,ind1] = min(eachLevelFitness);
            lpbest = [lpbest; eachLevelSol(ind1, :)];    % 获得lpbest
        end
        xPBest = lpbest(randi(k), :);

        r1 = randi(popsize);
        while r1 == i
            r1 = randi(popsize);
        end
        SolA = [sub_x; A];
        r2 = randi(size(SolA, 1));
        while r2 == r1 || r2 == i
            r2 = randi(size(SolA, 1));
        end
        mutantPos = sub_x(i, :) + F * (xPBest - sub_x(i, :)) + F * (sub_x(r1, :) - SolA(r2, :));    % 突变

        jj = randi(dim);  % 选择至少一维发生交叉
        for d = 1:dim
            if rand() < CR || d == jj
                crossoverPos(d) = mutantPos(d);
            else
                crossoverPos(d) = sub_x(i,d);
            end
        end
        
        crossoverPos(crossoverPos>UB) = UB;     % 检查是否越界
        crossoverPos(crossoverPos<LB) = LB;

        best_x(:,index1) = crossoverPos;
        evalNewPos = Fun(best_x);    % 将突变和交叉后的变量重新评估
        if evalNewPos < sample_y(i)    % 小于原有值就更新
            A = [A; sub_x(i,:)];
            if size(A, 1) > popsize
                A(randi(size(A, 1)), :) = [];    % 保持A的数目不超过popsize
            end
            SCR = [SCR; CR];
            SF = [SF; F];
            sub_x(i,:) = crossoverPos;
            sample_y(i) = evalNewPos;
        end
    end

    muCR = (1 - c) * muCR + c * mean(SCR);
    muF = (1 - c) * muF + c * (sum(SF .* SF) / sum(SF));
end
end